"use strict";

const moduleFiles = require.context("./modules", false, /\.js$/);
// 所有api子系统集合
export default moduleFiles.keys().reduce((obj, path) => {
  const moduleItem = moduleFiles(path).default || moduleFiles(path);
  const basePath = moduleItem.basePath || "";
  const objItem = Object.entries(moduleItem.apiList).reduce((obj, [key, value]) => {
    obj[key] = basePath.replace(/\W*$/, "") + "/" + value.replace(/^\W*/, "");
    return obj;
  }, {});
  return { ...obj, ...objItem };
}, {});
